package Classwork;
import java.io.*;
public class Work10 {
    public static void main(String[] args) throws IOException{
        try(
            FileInputStream fi=new FileInputStream("D:\\r'j'j\\Pictures\\Camera Roll\\WIN_20211126_16_03_27_Pro.jpg");
            FileOutputStream fo=new FileOutputStream("D:\\r'j'j\\Pictures\\Camera Roll\\WIN_20211126_16_03_27_Pro1.jpg")
                )
        {
            System.out.println("文件大小="+fi.available());
            byte[] b=new byte[fi.available()];
            fi.read(b);
            fo.write(b);
            System.out.println("文件名已被复制并改名");
        }
    }
}
